import React from "react";

export default function Counter({value, message, add, sub, say}) {
  return (<div>
    <h2>UI组件,只负责渲染,不包含逻辑</h2>
    <p>{value}</p>
    <p>P {message}</p>
    <button onClick={add}>counter+1</button>
    <button onClick={sub}>counter-1</button>
    <button onClick={say}>message-1</button>
  </div>)
}